import service from "@/service";
import type {IOper} from "@/myTypes"

interface IAdmin {
  adminname: string;
  password: string;
}

// 1、登录
export const loginApi = (data: IAdmin) =>
  service({
    url: "/admin/login",
    method: "post",
    data,
  });

// 2、管理员添加
export const addOperApi = (data:IOper)=>service.post("/admin/add",data);


// 3、管理员删除
export const removeOperApi = (adminid:string)=>service.post("/admin/delete",{adminid});

// 4、管理员修改
export const editOperApi = (data:IOper)=>service.post("/admin/update",data);


// 5、获取所有的管理员
export const getOperListApi = ()=>service.get("/admin/list");


//6、获取某个管理员的信息：
export const getOperDetailApi = (adminname:string)=>service.get("/admin/detail",{params:{adminname}});
